home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / enscript.4 / enscript / enscript-1.4.0 / aclocal.m4 < prev    next >
Encoding:
M4 Source File  |  1996-06-13  |  13.5 KB  |  453 lines

  1.  
  2. dnl
  3. dnl Gettext-0.10.16 aclocal.m4
  4. dnl
  5.  
  6. AC_PREREQ(2.5)
  7.  
  8. AC_DEFUN(md_TYPE_PTRDIFF_T,
  9.   [AC_CACHE_CHECK([for ptrdiff_t], ac_cv_type_ptrdiff_t,
  10.      [AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
  11.              ac_cv_type_ptrdiff_t=yes, ac_cv_type_ptrdiff_t=no)])
  12.    if test $ac_cv_type_ptrdiff_t = yes; then
  13.      AC_DEFINE(HAVE_PTRDIFF_T)
  14.    fi
  15. ])
  16.  
  17. dnl ------------------------
  18. dnl Emacs LISP file handling
  19. dnl ------------------------
  20. AC_DEFUN(ud_PATH_LISPDIR,
  21.  [AC_PATH_PROG(EMACS, emacs, no)
  22.   if test $EMACS != "no"; then
  23.     AC_MSG_CHECKING([where .elc files should go])
  24.     dnl Set default value
  25.     LISPDIR="\$(datadir)/emacs/site-lisp"
  26.     if test "x$prefix" = "xNONE"; then
  27.       if test -d $ac_default_prefix/share/emacs/site-lisp; then
  28.     LISPDIR="\$(prefix)/share/emacs/site-lisp"
  29.       else
  30.     if test -d $ac_default_prefix/lib/emacs/site-lisp; then
  31.       LISPDIR="\$(prefix)/lib/emacs/site-lisp"
  32.     fi
  33.       fi
  34.     else
  35.       if test -d $prefix/share/emacs/site-lisp; then
  36.     LISPDIR="\$(prefix)/share/emacs/site-lisp"
  37.       else
  38.     if test -d $prefix/lib/emacs/site-lisp; then
  39.       LISPDIR="\$(prefix)/lib/emacs/site-lisp"
  40.     fi
  41.       fi
  42.     fi
  43.     AC_MSG_RESULT($LISPDIR)
  44.     ELCFILES="\$(ELCFILES)"
  45.   fi
  46.   AC_SUBST(LISPDIR)
  47.   AC_SUBST(ELCFILES)])
  48.  
  49. dnl --------------------------------------------------------- ##
  50. dnl Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
  51. dnl substitution.                                             ##
  52. dnl --------------------------------------------------------- ##
  53.  
  54. AC_DEFUN(fp_PROG_INSTALL,
  55. [AC_PROG_INSTALL
  56. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
  57. AC_SUBST(INSTALL_SCRIPT)dnl
  58. ])
  59.  
  60. dnl --------------------------------------------------------- ##
  61. dnl The following definitions and this message have to go     ##
  62. dnl into the aclocal.m4 files of the packages to be           ##
  63. dnl internationalized.                                        ##
  64. dnl Last updated for gettext-0.10.16.                         ##
  65. dnl --------------------------------------------------------- ##
  66.  
  67. AC_DEFUN(md_PATH_PROG,
  68.   [AC_PATH_PROG($1,$2,$3)dnl
  69.    if echo $$1 | grep openwin > /dev/null; then
  70.      echo "WARNING: Do not use OpenWin's $2.  (Better remove it.)" >&AC_FD_MSG
  71.      ac_cv_path_$1=$2
  72.      $1=$2
  73.    fi
  74. ])
  75.  
  76. dnl Check NLS options
  77.  
  78. AC_DEFUN(ud_LC_MESSAGES,
  79.   [if test $ac_cv_header_locale_h = yes; then
  80.     AC_CACHE_CHECK([for LC_MESSAGES], ud_cv_val_LC_MESSAGES,
  81.       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  82.        ud_cv_val_LC_MESSAGES=yes, ud_cv_val_LC_MESSAGES=no)])
  83.     if test $ud_cv_val_LC_MESSAGES = yes; then
  84.       AC_DEFINE(HAVE_LC_MESSAGES)
  85.     fi
  86.   fi])
  87.  
  88. AC_DEFUN(ud_WITH_NLS,
  89.   [AC_MSG_CHECKING([whether NLS is requested])
  90.     dnl Default is enabled NLS
  91.     AC_ARG_ENABLE(nls,
  92.       [  --disable-nls           do not use Native Language Support],
  93.       USE_NLS=$enableval, USE_NLS=yes)
  94.     AC_MSG_RESULT($USE_NLS)
  95.     AC_SUBST(USE_NLS)
  96.  
  97.     USE_INCLUDED_LIBINTL=no
  98.  
  99.     dnl If we use NLS figure out what method
  100.     if test "$USE_NLS" = "yes"; then
  101.       AC_DEFINE(ENABLE_NLS)
  102.       AC_MSG_CHECKING([for explicitly using GNU gettext])
  103.       AC_ARG_WITH(included-gettext,
  104.         [  --with-included-gettext use the GNU gettext library included here],
  105.         nls_cv_force_use_gnu_gettext=$withval,
  106.         nls_cv_force_use_gnu_gettext=no)
  107.       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
  108.  
  109.       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  110.       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  111.         dnl User does not insist on using GNU NLS library.  Figure out what
  112.         dnl to use.  If gettext or catgets are available (in this order) we
  113.         dnl use this.  Else we have to fall back to GNU NLS library.
  114.     dnl catgets is only used if permitted by option --with-catgets.
  115.     nls_cv_header_intl=
  116.     nls_cv_header_libgt=
  117.     CATOBJEXT=NONE
  118.  
  119.     AC_CHECK_HEADER(libintl.h,
  120.       [AC_CHECK_LIB(intl, bindtextdomain)
  121.        AC_CHECK_FUNC(gettext,
  122.          [AC_DEFINE(HAVE_GETTEXT)
  123.           md_PATH_PROG(MSGFMT, msgfmt, no)dnl
  124.           if test "$MSGFMT" != "no"; then
  125.         AC_CHECK_FUNCS(dcgettext)
  126.         md_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  127.         md_PATH_PROG(XGETTEXT, xgettext, :)
  128.         AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
  129.                    return _nl_msg_cat_cntr],
  130.           [CATOBJEXT=.gmo
  131.            DATADIRNAME=share],
  132.           [CATOBJEXT=.mo
  133.            DATADIRNAME=lib])
  134.         INSTOBJEXT=.mo
  135.           fi])])
  136.  
  137.         if test "$CATOBJEXT" = "NONE"; then
  138.       AC_MSG_CHECKING([whether catgets can be used])
  139.       AC_ARG_WITH(catgets,
  140.         [  --with-catgets          use catgets functions if available],
  141.         nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
  142.       AC_MSG_RESULT($nls_cv_use_catgets)
  143.  
  144.       if test "$nls_cv_use_catgets" = "yes"; then
  145.         dnl No gettext in C library.  Try catgets next.
  146.         AC_CHECK_LIB(i, main)
  147.         AC_CHECK_FUNC(catgets,
  148.           [AC_DEFINE(HAVE_CATGETS)
  149.            INTLOBJS="\$(CATOBJS)"
  150.            AC_PATH_PROG(GENCAT, gencat, no)dnl
  151.            if test "$GENCAT" != "no"; then
  152.          AC_PATH_PROGS(GMSGFMT, [gmsgfmt msgfmt], msgfmt)
  153.          md_PATH_PROG(XGETTEXT, xgettext, :)
  154.          USE_INCLUDED_LIBINTL=yes
  155.          CATOBJEXT=.cat
  156.          INSTOBJEXT=.cat
  157.          DATADIRNAME=lib
  158.          INTLDEPS="../intl/libintl.a"
  159.          INTLLIBS=$INTLDEPS
  160.          LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  161.          nls_cv_header_intl=intl/libintl.h
  162.          nls_cv_header_libgt=intl/libgettext.h
  163.            fi])
  164.       fi
  165.         fi
  166.  
  167.         if test "$CATOBJEXT" = "NONE"; then
  168.       dnl Neither gettext nor catgets in included in the C library.
  169.       dnl Fall back on GNU gettext library.
  170.       nls_cv_use_gnu_gettext=yes
  171.         fi
  172.       fi
  173.  
  174.       if test "$nls_cv_use_gnu_gettext" = "yes"; then
  175.         dnl Mark actions used to generate GNU NLS library.
  176.         INTLOBJS="\$(GETTOBJS)"
  177.         md_PATH_PROG(MSGFMT, msgfmt, msgfmt)
  178.         md_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  179.         md_PATH_PROG(XGETTEXT, xgettext, :)
  180.         AC_SUBST(MSGFMT)
  181.     USE_INCLUDED_LIBINTL=yes
  182.         CATOBJEXT=.gmo
  183.         INSTOBJEXT=.mo
  184.         DATADIRNAME=share
  185.     INTLDEPS="../intl/libintl.a"
  186.     INTLLIBS=$INTLDEPS
  187.     LIBS=`echo $LIBS | sed -e 's/-lintl//'`
  188.         nls_cv_header_intl=intl/libintl.h
  189.         nls_cv_header_libgt=intl/libgettext.h
  190.       fi
  191.  
  192.       dnl Test whether we really found GNU xgettext.
  193.       if test "$XGETTEXT" != ":"; then
  194.     dnl If it is no GNU xgettext we define it as : so that the
  195.     dnl Makefiles still can work.
  196.     if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  197.       : ;
  198.     else
  199.       AC_MSG_RESULT(
  200.         [found xgettext programs is not GNU xgettext; ignore it])
  201.       XGETTEXT=":"
  202.     fi
  203.       fi
  204.  
  205.       # We need to process the po/ directory.
  206.       POSUB=po
  207.     else
  208.       DATADIRNAME=share
  209.       nls_cv_header_intl=intl/libintl.h
  210.       nls_cv_header_libgt=intl/libgettext.h
  211.     fi
  212.  
  213.     # If this is used in GNU gettext we have to set USE_NLS to `yes'
  214.     # because some of the sources are only built for this goal.
  215.     if test "$PACKAGE" = gettext; then
  216.       USE_NLS=yes
  217.       USE_INCLUDED_LIBINTL=yes
  218.     fi
  219.  
  220.     dnl These rules are solely for the distribution goal.  While doing this
  221.     dnl we only have to keep exactly one list of the available catalogs
  222.     dnl in configure.in.
  223.     for lang in $ALL_LINGUAS; do
  224.       GMOFILES="$GMOFILES $lang.gmo"
  225.       POFILES="$POFILES $lang.po"
  226.     done
  227.  
  228.     dnl Make all variables we use known to autoconf.
  229.     AC_SUBST(USE_INCLUDED_LIBINTL)
  230.     AC_SUBST(CATALOGS)
  231.     AC_SUBST(CATOBJEXT)
  232.     AC_SUBST(DATADIRNAME)
  233.     AC_SUBST(GMOFILES)
  234.     AC_SUBST(INSTOBJEXT)
  235.     AC_SUBST(INTLDEPS)
  236.     AC_SUBST(INTLLIBS)
  237.     AC_SUBST(INTLOBJS)
  238.     AC_SUBST(POFILES)
  239.     AC_SUBST(POSUB)
  240.   ])
  241.  
  242. AC_DEFUN(ud_GNU_GETTEXT,
  243.   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  244.    AC_REQUIRE([AC_PROG_CC])dnl
  245.    AC_REQUIRE([AC_ISC_POSIX])dnl
  246.    AC_REQUIRE([AC_PROG_RANLIB])dnl
  247.    AC_REQUIRE([AC_HEADER_STDC])dnl
  248.    AC_REQUIRE([AC_C_CONST])dnl
  249.    AC_REQUIRE([AC_C_INLINE])dnl
  250.    AC_REQUIRE([AC_TYPE_OFF_T])dnl
  251.    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  252.    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  253.    AC_REQUIRE([AC_FUNC_MMAP])dnl
  254.  
  255.    AC_CHECK_HEADERS([limits.h locale.h nl_types.h malloc.h string.h unistd.h values.h])
  256.    AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
  257. __argz_count __argz_stringify __argz_next])
  258.  
  259.    if test "${ac_cv_func_stpcpy+set}" != "set"; then
  260.      AC_CHECK_FUNCS(stpcpy)
  261.    fi
  262.    if test "${ac_cv_func_stpcpy}" = "yes"; then
  263.      AC_DEFINE(HAVE_STPCPY)
  264.    fi
  265.  
  266.    ud_LC_MESSAGES
  267.    ud_WITH_NLS
  268.  
  269.    if test "x$CATOBJEXT" != "x"; then
  270.      if test "x$ALL_LINGUAS" = "x"; then
  271.        LINGUAS=
  272.      else
  273.        AC_MSG_CHECKING(for catalogs to be installed)
  274.        NEW_LINGUAS=
  275.        for lang in ${LINGUAS=$ALL_LINGUAS}; do
  276.          case "$ALL_LINGUAS" in
  277.           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  278.          esac
  279.        done
  280.        LINGUAS=$NEW_LINGUAS
  281.        AC_MSG_RESULT($LINGUAS)
  282.      fi
  283.  
  284.      dnl Construct list of names of catalog files to be constructed.
  285.      if test -n "$LINGUAS"; then
  286.        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  287.      fi
  288.    fi
  289.  
  290.    dnl Determine which catalog format we have (if any is needed)
  291.    dnl For now we know about two different formats:
  292.    dnl   Linux and the normal X/Open format
  293.    test -d intl || mkdir intl
  294.    if test "$CATOBJEXT" = ".cat"; then
  295.      AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
  296.  
  297.      dnl Transform the SED scripts while copying because some dumb SEDs
  298.      dnl cannot handle comments.
  299.      sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
  300.    fi
  301.    dnl po2tbl.sed is always needed.
  302.    sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
  303.      $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
  304.  
  305.    dnl In the intl/Makefile.in we have a special dependency which makes
  306.    dnl only sense for gettext.  We comment this out for non-gettext
  307.    dnl packages.
  308.    if test "$PACKAGE" = "gettext"; then
  309.      GT_NO="#NO#"
  310.      GT_YES=
  311.    else
  312.      GT_NO=
  313.      GT_YES="#YES#"
  314.    fi
  315.    AC_SUBST(GT_NO)
  316.    AC_SUBST(GT_YES)
  317.  
  318.    dnl Generate list of files to be processed by xgettext which will
  319.    dnl be included in po/Makefile.
  320.    test -d po || mkdir po
  321.    if test "x$srcdir" != "x."; then
  322.      if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
  323.        posrcprefix="$srcdir/"
  324.      else
  325.        posrcprefix="../$srcdir/"
  326.      fi
  327.    else
  328.      posrcprefix="../"
  329.    fi
  330.    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,    $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
  331.     < $srcdir/po/POTFILES.in > po/POTFILES
  332.   ])
  333.  
  334. dnl
  335. dnl End of Gettext-0.10.16 aclocal.m4
  336. dnl
  337.  
  338. dnl
  339. dnl Automake-1.0 aclocal.m4 (without the re-definition of the fp_PROC_INSTALL)
  340. dnl
  341.  
  342. # Local additions to Autoconf macros.
  343. # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  344. # Franτois Pinard <pinard@iro.umontreal.ca>, 1992.
  345.  
  346. ## ------------------------------- ##
  347. ## Check for function prototypes.  ##
  348. ## ------------------------------- ##
  349.  
  350. AC_DEFUN(fp_C_PROTOTYPES,
  351. [AC_REQUIRE([fp_PROG_CC_STDC])
  352. AC_MSG_CHECKING([for function prototypes])
  353. if test "$ac_cv_prog_cc_stdc" != no; then
  354.   AC_MSG_RESULT(yes)
  355.   AC_DEFINE(PROTOTYPES)
  356.   U= ANSI2KNR=
  357. else
  358.   AC_MSG_RESULT(no)
  359.   U=_ ANSI2KNR=./ansi2knr
  360. fi
  361. AC_SUBST(U)dnl
  362. AC_SUBST(ANSI2KNR)dnl
  363. ])
  364.  
  365. ## ----------------------------------------- ##
  366. ## ANSIfy the C compiler whenever possible.  ##
  367. ## ----------------------------------------- ##
  368.  
  369. # @defmac AC_PROG_CC_STDC
  370. # @maindex PROG_CC_STDC
  371. # @ovindex CC
  372. # If the C compiler in not in ANSI C mode by default, try to add an option
  373. # to output variable @code{CC} to make it so.  This macro tries various
  374. # options that select ANSI C on some system or another.  It considers the
  375. # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
  376. # handles function prototypes correctly.
  377. #
  378. # If you use this macro, you should check after calling it whether the C
  379. # compiler has been set to accept ANSI C; if not, the shell variable
  380. # @code{ac_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  381. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  382. # program @code{ansi2knr}, which comes with Ghostscript.
  383. # @end defmac
  384.  
  385. AC_DEFUN(fp_PROG_CC_STDC,
  386. [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  387. AC_CACHE_VAL(ac_cv_prog_cc_stdc,
  388. [ac_cv_prog_cc_stdc=no
  389. ac_save_CFLAGS="$CFLAGS"
  390. # Don't try gcc -ansi; that turns off useful extensions and
  391. # breaks some systems' header files.
  392. # AIX            -qlanglvl=ansi
  393. # Ultrix and OSF/1    -std1
  394. # HP-UX            -Aa -D_HPUX_SOURCE
  395. # SVR4            -Xc
  396. for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
  397. do
  398.   CFLAGS="$ac_save_CFLAGS $ac_arg"
  399.   AC_TRY_COMPILE(
  400. [#if !defined(__STDC__) || __STDC__ != 1
  401. choke me
  402. #endif
  403. ], [int test (int i, double x);
  404. struct s1 {int (*f) (int a);};
  405. struct s2 {int (*f) (double a);};],
  406. [ac_cv_prog_cc_stdc="$ac_arg"; break])
  407. done
  408. CFLAGS="$ac_save_CFLAGS"
  409. ])
  410. AC_MSG_RESULT($ac_cv_prog_cc_stdc)
  411. case "x$ac_cv_prog_cc_stdc" in
  412.   x|xno) ;;
  413.   *) CC="$CC $ac_cv_prog_cc_stdc" ;;
  414. esac
  415. ])
  416.  
  417. ## --------------------------------------------------------- ##
  418. ## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
  419. ## substitution.                                             ##
  420. ## --------------------------------------------------------- ##
  421. #
  422. # AC_DEFUN(fp_PROG_INSTALL,
  423. # [AC_PROG_INSTALL
  424. # test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
  425. # AC_SUBST(INSTALL_SCRIPT)dnl
  426. # ])
  427.  
  428.  
  429. # Add --enable-maintainer-mode option to configure.
  430. AC_DEFUN(jm_MAINTAINER_MODE,
  431. [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  432.   dnl maintainer-mode is disabled by default
  433.   AC_ARG_ENABLE(maintainer-mode,
  434. [  --enable-maintainer-mode enable make rules and dependencies not useful
  435.                           (and sometimes confusing) to the casual installer],
  436.       USE_MAINTAINER_MODE=$enableval,
  437.       USE_MAINTAINER_MODE=no)
  438.   AC_MSG_RESULT($USE_MAINTAINER_MODE)
  439.   if test $USE_MAINTAINER_MODE = yes; then
  440.     MAINT=
  441.   else
  442.     MAINT='#M#'
  443.   fi
  444.   AC_SUBST(MAINT)dnl
  445. ]
  446. )
  447.  
  448.  
  449. dnl
  450. dnl End of Automake-1.0 aclocal.m4
  451. dnl
  452.  
  453.